package com.example.tongyiwanxiangdemo.draw.controller;

import com.alibaba.dashscope.aigc.imagesynthesis.ImageSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.example.tongyiwanxiangdemo.draw.pojo.DrawPO;
import com.example.tongyiwanxiangdemo.draw.pojo.DrawVO;
import com.example.tongyiwanxiangdemo.draw.service.DrawService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author xiaoshan
 */
@RestController
@RequestMapping("/draw")
@Api(tags = "绘画接口")
public class DrawController {

    @Resource
    private DrawService drawService;

    @PostMapping("/synchronization")
    @ApiOperation(value = "同步绘画")
    public DrawVO drawWithSynchronization(@RequestBody DrawPO drawPo) throws ApiException, NoApiKeyException {
        drawService.drawWithSynchronization(drawPo);
        return null;
    }
}
